package com.yangmao.service.impl;

import com.github.pagehelper.PageHelper;
import com.yangmao.dao.PhysicalDao;
import com.yangmao.entity.Physical;
import com.yangmao.service.api.PhysicalService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author ‘洋毛’
 * @version 1.0
 * @description: TODO
 * @date 2022/1/11 14:23
 */
@Service
public class PhysicalImpl implements PhysicalService {
    @Autowired
    private PhysicalDao physicaldao;

    @Override
    public List<Physical> getAllPhysical(int page, int size) {
        PageHelper.startPage(page,size);
        return physicaldao.getAllPhysical();
    }

    @Override
    public void updatePhysical(Physical physical) {
        physicaldao.updatePhysical(physical);
    }

    @Override
    public void deletePhysical(String id) {
        physicaldao.deletePhysical(id);
    }

    @Override
    public void addPhysical(Physical physical) {
        physicaldao.addPhysical(physical);
    }

    @Override
    public Physical getPhysicalById(String id) {
        return physicaldao.getPhysicalById(id);
    }
}
